package com.gitee.zou8944.ipersist.core

interface SqlSession {

    fun <R> selectOne(statementId: String, entity: Any?): R?

    fun <R> selectList(statementId: String, entity: Any?): List<R>

    fun updateOne(statementId: String, entity: Any?): Int

    fun insertOne(statementId: String, entity: Any?): Int

    fun deleteOne(statementId: String, entity: Any?): Int

    /**
     * 根据传入接口生成mapper的动态代理对象
     */
    fun <T> getMapper(clazz: Class<T>): T

    fun close()
}